package com.bmps.springcloud.insuredmicroservice.callback.calculate;

import com.bmps.springcloud.common.response.TaskResponseModel;
import com.bmps.springcloud.insuredmicroservice.model.accept.LcPolModel;
import com.bmps.springcloud.insuredmicroservice.service.calculate.AccountValueInsuranceService;

import java.util.concurrent.Callable;

/**
 * description:
 * 计算账户价值
 *
 * @author jackdaw
 * @date 2019-12-25 15:00
 */
public class CalculateAccountValueCallBack implements Callable<TaskResponseModel> {
    private String key;
    private LcPolModel lcPolModel;
    private final AccountValueInsuranceService accountValueInsuranceService;

    public CalculateAccountValueCallBack(String key, LcPolModel lcPolModel, AccountValueInsuranceService accountValueInsuranceService) {
        this.setKey(key);
        this.accountValueInsuranceService = accountValueInsuranceService;
        this.lcPolModel = lcPolModel;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public LcPolModel getLcPolModel() {
        return lcPolModel;
    }

    public void setLcPolModel(LcPolModel lcPolModel) {
        this.lcPolModel = lcPolModel;
    }

    @Override
    public TaskResponseModel call() throws Exception {
        return accountValueInsuranceService.accountValue(key, lcPolModel);
    }
}



